determine the distance